﻿#ifndef CARD_H
#define CARD_H

#include <iostream>
#include <string>
#include <windows.h>
#include "Point.h"

#define CARD_VISUAL_HEIGHT 9
#define CARD_VISUAL_WIDTH 8


#define NB_KIND 4
#define SPADE 1
#define CLUB 2
#define DIAMOND 3
#define HEART 4
#define MAX_SPADE 50

#define FACE true
#define BACK false

#define NB_SYMBOL 13
#define LEN_SYMBOL 3

#define NB_BORDER 6
#define CORNER_TOP_LEFT 0
#define CORNER_TOP_RIGHT 1
#define CORNER_BOTTOM_LEFT 2
#define CORNER_BOTTOM_RIGHT 3
#define CARD_EDGE 4
#define CARD_SIDE 5


const point<int> symbolTopLeft = { 1, 1 };
const point<int> kindTopLeft = { 2, 1 };
const point<int> kindMiddle = { 4, 3 };
const point<int> kindBottomRight = { 6, 5 };
const point<int> symbolBottomRight = { 7, 5 };


const char borders[NB_BORDER] = { char(218), char(191), char(192), char(217), char(196), char(179) };

const char kinds[NB_KIND] = { char(6), char(5), char(4), char(3) };

const char symbols[NB_SYMBOL][LEN_SYMBOL] = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };

const char cardBackFill = char(178);



const char cardVisual[CARD_VISUAL_HEIGHT][CARD_VISUAL_WIDTH] =
{
	{ " _____ " },  
	{ "|4    |" }, 
	{ "|k    |" }, 
	{ "|     |" }, 
	{ "|  k  |" }, 
	{ "|     |" }, 
	{ "|    k|" }, 
	{ "|    4|" }, 
	{ "|_____|" } 
};

const char cardVisualBack[CARD_VISUAL_HEIGHT][CARD_VISUAL_WIDTH] =
{
	{ " _____ " },
	{ "|     |" },
	{ "|     |" },
	{ "|     |" },
	{ "|     |" },
	{ "|     |" },
	{ "|     |" },
	{ "|     |" },
	{ "|_____|" },
};


struct card
{
	int value;
	char symbol[LEN_SYMBOL];
	int kind;
	int sequence;
};


void InitializeCard(card &c, int value, char kind, int sequence);
void DisplayCard(const card &c, int x, int y, bool side);
void GotoXY(int x, int y);

#endif
